import torch.nn as nn

class LossCompute(object):
    def __init__(self):
        self.criterion = nn.BCELoss()

    def __call__(self, x, y):
        """
        Call to compute loss
        :param x: predicted value
        :param y: actual value
        :return:
        """
        loss = self.criterion(x, y)
        return loss